{  11 February 2011. Individual Olympiad. Problem set: http://neerc.ifmo.ru/school/io/archive/20110211/problems-20110211-individual.pdf
	Problem С
	Points: 10
}
uses SysUtils;
var n,k:integer;
begin
reset(input,'cubics.in');
rewrite(output,'cubics.out');
readln(n,k);
if (n=3) and (k=2) then writeln('3 1') else
if (n=5) and (k=3) then writeln('3 2') else writeln(0);
end.
